package cn.tedu.controller;

import cn.tedu.pojo.Novel;
import cn.tedu.service.CollectService;
import cn.tedu.service.NovelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class NovelController {

    @Autowired
    private NovelService novelService;

    //查看所有收藏书籍
    @GetMapping("/getNovelByUserId")
    public List<Novel> getNovelByUserId(@RequestParam("userId") Integer userId){
        List<Novel> novels = novelService.getNovelByUserId(userId);
        return novels;
    }
}
